<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>登录页面</title>
    <link rel="stylesheet" href="../css/common.css">
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        
        body {
            background-color: #f5f5f5;
        }

        .header {
            background-color: #87CEEB;
        }
        
        .header-content {
            width: 1200px;
            margin: 0 auto;
            height: 60px;
            line-height: 60px;
            color: white;
            font-size: 24px;
        }

        .login-container {
            width: 500px;
            margin: 100px auto;
            padding: 40px;
            background: #fff;
            border-radius: 12px;
            border: 1px solid #ffd6d6;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        }

        .form-group {
            margin: 30px 0;
        }

        .form-group label {
            display: inline-block;
            width: 80px;
            text-align: right;
            margin-right: 15px;
            font-size: 16px;
        }

        .form-group input {
            width: 300px;
            padding: 12px;
            border: 1px solid #ddd;
            border-radius: 6px;
            font-size: 16px;
        }

        .links {
            margin: 20px 0;
            padding-left: 0;
            font-size: 16px;
            display: flex;
            justify-content: flex-start;
            margin-left: 80px;
            margin-right: 15px;
        }

        .links a {
            color: #87CEEB;
            text-decoration: none;
            margin-right: 10px;
        }

        .login-btn {
            width: 300px;
            margin: 0 auto;
            display: block;
            padding: 12px;
            background: #87CEEB;
            border: none;
            border-radius: 6px;
            cursor: pointer;
            font-size: 18px;
            color: white;
            transition: background-color 0.3s;
        }

        .login-btn:hover {
            background: #75bcd6;
        }

        .error-message {
            color: red;
            text-align: center;
            margin-bottom: 20px;
            display: none;
        }

        .password-wrapper {
            position: relative;
            display: inline-block;
            width: 300px;
        }

        .password-toggle {
            position: absolute;
            right: 8px;
            top: 50%;
            transform: translateY(-50%);
            width: 24px;
            height: 24px;
            border: none;
            background: none;
            cursor: pointer;
            padding: 0;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .password-toggle:hover svg path {
            fill: #666;
        }
    </style>
</head>
<body>
    <header class="header">
        <div class="header-content">
            登录页面
        </div>
    </header>

    <div class="login-container">
        <div class="error-message" id="errorMessage">用户名或密码错误！</div>
        
        <form id="loginForm">
            <div class="form-group">
                <label for="username">用户名:</label>
                <input type="text" id="username" name="username" required>
            </div>
            
            <div class="form-group">
                <label for="password">密 码:</label>
                <div class="password-wrapper">
                    <input type="password" id="password" name="password" required>
                    <button type="button" class="password-toggle" onclick="togglePassword('password')">
                        <svg viewBox="0 0 24 24" width="16" height="16">
                            <path class="show-pwd" fill="#999" d="M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"/>
                            <path class="hide-pwd" fill="#999" d="M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z" style="display: none;"/>
                        </svg>
                    </button>
                </div>
            </div>

            <div class="links">
                <span>还没账号，</span>
                <a href="register.html" style="color: #f40;">去注册</a>
            </div>

            <button type="submit" class="login-btn">登录</button>
        </form>
    </div>

    <script src="https://cdn.bootcdn.net/ajax/libs/qs/6.9.4/qs.min.js"></script>
    <script src="../lib/axios.min.js"></script>
    <script src="../js/config.js"></script>
    <script src="../js/login.js"></script>
</body>
</html> 